// MAttitudeWidget.h: Schnittstelle f�r die Klasse MAttitudeWidget.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MATTITUDEWIDGET_H__7329F309_35B1_47A6_A665_AC66762F860B__INCLUDED_)
#define AFX_MATTITUDEWIDGET_H__7329F309_35B1_47A6_A665_AC66762F860B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <QtCore>
#include <QtGui>

#include "MiriamDial01.h"

class MProgressBar;

class MAttitudeWidget : public MiriamDial01//QWidget
{
    Q_OBJECT
            Q_PROPERTY(QString title READ title WRITE setTitle DESIGNABLE true)
            Q_PROPERTY(QColor middleColor READ middleColor WRITE setMiddleColor DESIGNABLE true)         
            Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor DESIGNABLE true)
            Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor DESIGNABLE true)                  
            Q_PROPERTY(int labelWidth READ labelWidth WRITE setLabelWidth DESIGNABLE true)
            Q_PROPERTY(int labelHeight READ labelHeight WRITE setLabelHeight DESIGNABLE true)
            Q_PROPERTY(int barDim READ barDim WRITE setBarDim DESIGNABLE true)
            Q_PROPERTY(double safeMinimum READ safeMinimum WRITE setSafeMinimum DESIGNABLE true)
            Q_PROPERTY(double safeMaximum READ safeMaximum WRITE setSafeMaximum DESIGNABLE true)
            Q_PROPERTY(double minimum READ minimum WRITE setMinimum DESIGNABLE true)
            Q_PROPERTY(double maximum READ maximum WRITE setMaximum DESIGNABLE true)
            Q_PROPERTY(QString suffix READ suffix WRITE setSuffix DESIGNABLE true)
            Q_PROPERTY(QColor markerColor READ markerColor WRITE setMarkerColor DESIGNABLE true)
public:
	MAttitudeWidget(QWidget * parent = 0 );
	virtual ~MAttitudeWidget();
protected:
	void resizeEvent(QResizeEvent * event);
private:
	QLabel* lblTitle;
	QLabel* lblValue;
	MProgressBar* bar;
    int m_labelWidth,
        m_labelHeight;
    QColor m_middleColor,
           m_textColor,
           m_backgroundColor;

public:
	void setTitle(const QString title);
private:
	bool m_titleVisible;
	void showTitle(bool show = true){m_titleVisible = show;}
private:
	QString m_suffix;
public:
	void setSuffix(const QString text){m_suffix = text;};
	void setValue(const double v);
	double value();
	void setMinimum(const double value);
	void setMaximum(const double value);
	double minimum()const ;
	double maximum()const ;
	void setSafeMinimum(const double value);
	void setSafeMaximum(const double value);
    const QColor & backgroundColor() const;
    const QColor & middleColor() const;
    const QColor & textColor() const;
    const QString & suffix() const;
    int labelHeight() const;
    int labelWidth() const;
    void setBarDim(int dim);
    void setLabelHeight(int height);
    void setLabelWidth(int width);
    void setTextColor(QColor textColor);
    QString title();
    int barDim();
    double safeMinimum();
    double safeMaximum();
    
};

#endif // !defined(AFX_MATTITUDEWIDGET_H__7329F309_35B1_47A6_A665_AC66762F860B__INCLUDED_)
